﻿package mortal.game.view.friend.renderer
{
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.friend.data.*;

    public class FriendRecommendRenderer extends GCellRenderer
    {
        private var _roleName:GTextFiled;
        private var _roleSex:GTextFiled;
        private var _roleLevel:GTextFiled;
        private var _combat:GTextFiled;
        private var _addBtn:GButton;

        public function FriendRecommendRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.pushUIToDisposeVec(UIFactory.bg(0, 0, 415, 33, this, ImagesConst.RegionTitleBg));
            this._roleName = UIFactory.gTextField("", 5, 7, 100, 20, this);
            this._roleSex = UIFactory.gTextField("", 119 + 6, 7, 35, 20, this);
            this._roleLevel = UIFactory.gTextField("", 197, 7, 26, 20, this);
            this._combat = UIFactory.gTextField("", 260 + 8, 7, 80, 20, this);
            this._addBtn = UIFactory.gButton(Language.getString(41208), 340, 4, 68, 26, this);
            this._addBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as RoleInfoData;
            this._roleName.text = _loc_2.roleName;
            this._roleSex.text = _loc_2.roleSex;
            this._roleLevel.text = _loc_2.roleLevel + "";
            this._combat.text = _loc_2.roleCombat + "";
            return;
        }// end function

        private function onClickHandler(event:MouseEvent) : void
        {
            var _loc_2:* = (_data as RoleInfoData).roleName;
            GameProxy.friend.apply([_loc_2]);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._roleName.dispose(param1);
            this._roleSex.dispose(param1);
            this._roleLevel.dispose(param1);
            this._combat.dispose(param1);
            this._addBtn.dispose(param1);
            this._roleName = null;
            this._roleSex = null;
            this._roleLevel = null;
            this._combat = null;
            this._addBtn = null;
            return;
        }// end function

    }
}
